Skip to content

[rolling fallback] incentive dutch auction - #1127

Merged
peyha merged 13 commits into
blue-fallback-rollingfrom
blue-fallback-rolling-auction
Aug 10, 2026
Merged

peyha merged 13 commits into
blue-fallback-rollingfrom
blue-fallback-rolling-auction

Conversation

@peyha

@peyha peyha commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@peyha peyha changed the title feat: auction [rolling fallback] incentive dutch auction Aug 5, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 35cc852e60

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread test/BlueFallbackRollingFactoryTest.sol Outdated
Comment on lines 93 to +97
require(
blueMarketParams.collateralToken == midnightMarket.collateralParams[collateralIndex].token,
InconsistentCollateralToken()
);
require(midnightMarket.collateralParams[collateralIndex].lltv <= blueMarketParams.lltv, BlueLltvTooLow());

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these checks (as well as the loan token check) are not perfect because the users could set non-valid configs

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

potential solution, check these in setConfig and use a midnight and blue market instead of their respective ids (it would be more expensive in calldata though)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not too bad that one can set an invalid config, but IMO we should do either all checks in setConfig (meaning you can't enable an invalid config) or all checks in roll

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imho it's better to do all check in setConfig to prevent a user from setting something invalid by accident, feeling safe, and then getting liquidated because rolling was not possible.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are currently 4 checks on a given config: start <= end, incentives <= WAD, loan token match and collateral token match. We can't really check the collateral tokens because the config might be set before the user supply any collateral into midnight. It's also more expensive in gas to check the loan token in setConfig because in the current version we only use the market Ids. So I slightly favor the current version

Comment thread src/periphery/blue-fallback-rolling/BlueFallbackRolling.sol Outdated
@peyha
peyha requested review from MathisGD and chrmatt August 7, 2026 14:07
Comment thread src/periphery/blue-fallback-rolling/BlueFallbackRolling.sol Outdated
Comment thread src/periphery/blue-fallback-rolling/BlueFallbackRolling.sol Outdated
Comment thread src/periphery/blue-fallback-rolling/BlueFallbackRolling.sol Outdated
Comment thread src/periphery/blue-fallback-rolling/BlueFallbackRolling.sol Outdated
Comment thread src/periphery/blue-fallback-rolling/BlueFallbackRolling.sol

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0e54c34760

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/periphery/blue-fallback-rolling/BlueFallbackRolling.sol Outdated
Comment thread src/periphery/blue-fallback-rolling/BlueFallbackRolling.sol Outdated

@chrmatt chrmatt left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems there is no test case to check that having a LLTV on Blue that is lower than the one on Midnight reverts.

Also added some comments. Otherwise looks good.

Comment thread src/periphery/blue-fallback-rolling/BlueFallbackRolling.sol Outdated
Comment on lines 93 to +97
require(
blueMarketParams.collateralToken == midnightMarket.collateralParams[collateralIndex].token,
InconsistentCollateralToken()
);
require(midnightMarket.collateralParams[collateralIndex].lltv <= blueMarketParams.lltv, BlueLltvTooLow());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imho it's better to do all check in setConfig to prevent a user from setting something invalid by accident, feeling safe, and then getting liquidated because rolling was not possible.

Comment thread src/periphery/blue-fallback-rolling/BlueFallbackRolling.sol Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 13104de76e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/periphery/blue-fallback-rolling/BlueFallbackRolling.sol
Comment thread src/periphery/blue-fallback-rolling/BlueFallbackRolling.sol
Comment thread src/periphery/blue-fallback-rolling/BlueFallbackRolling.sol Outdated
Comment thread src/periphery/blue-fallback-rolling/BlueFallbackRolling.sol Outdated
Comment thread src/periphery/blue-fallback-rolling/BlueFallbackRolling.sol Outdated
Comment thread src/periphery/blue-fallback-rolling/BlueFallbackRolling.sol Outdated
peyha and others added 2 commits August 10, 2026 17:44
Co-authored-by: MathisGD <74971347+MathisGD@users.noreply.github.com>
Signed-off-by: PA <50184410+peyha@users.noreply.github.com>
@peyha
peyha merged commit 1785a2b into blue-fallback-rolling Aug 10, 2026
55 checks passed
@peyha
peyha deleted the blue-fallback-rolling-auction branch August 10, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants